<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

/**
 * this controller loads the views for information pages like contac, impressum, agb,...
 * @author controller team
 *
 */
class Information extends CI_Controller {


	public function __construct()
	{
		parent::__construct();
		require_once('user.php');
		$this->user=new User();
	}

	/**
	 * shows view for user privacy 
	 */
	public function privacy()
	{
		//load header and check if logged in for login view
		$this->load->view('header');
		$loggedIn = $this->user->logged_in();
		$loginData['isLoggedIn'] = $loggedIn;
		if($loggedIn){
			$loginData['username'] = $_SESSION['username'];
		}
		$this->load->view('login', $loginData);
		
		//load menu view with the current menu tab active
		$menu['activeController'] = '';
		$this->load->view('menu',$menu);
		//load the privacy view
		$this->load->view('privacy');
		$this->load->view('footer');
	}

	public function contact(){
		
		//load header and check if logged in for login view
		$this->load->view('header');
		$loggedIn = $this->user->logged_in();
		$loginData['isLoggedIn'] = $loggedIn;
		if($loggedIn){
			$loginData['username'] = $_SESSION['username'];
		}
		$this->load->view('login', $loginData);

		$menu['activeController'] = '';
		//load menu view with the current menu tab active
		$this->load->view('menu',$menu);
		//load the contact view
		$this->load->view('contact');
		$this->load->view('footer');
	}


	public function generalTerms (){
		//load header and check if logged in for login view
		$this->load->view('header');
		$loggedIn = $this->user->logged_in();
		$loginData['isLoggedIn'] = $loggedIn;
		if($loggedIn){
			$loginData['username'] = $_SESSION['username'];
		}
		$this->load->view('login', $loginData);

		$menu['activeController'] = '';
		//load menu view with the current menu tab active
		$this->load->view('menu',$menu);
		//load the general terms view
		$this->load->view('general_terms');
		$this->load->view('footer');

	}


	public function legalInfo(){
		//load header and check if logged in for login view
		$this->load->view('header');
		$loggedIn = $this->user->logged_in();
		$loginData['isLoggedIn'] = $loggedIn;
		if($loggedIn){
			$loginData['username'] = $_SESSION['username'];
		}
		$this->load->view('login', $loginData);

		$menu['activeController'] = '';
		//load menu view with the current menu tab active
		$this->load->view('menu',$menu);
		$this->load->view('legal_info');
		$this->load->view('footer');

	}
	
}